Close bug #50615:
authorHavoc Pennington <hp@redhat.com>
Wed, 18 Apr 2001 20:16:38 +0000 (20:16 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Wed, 18 Apr 2001 20:16:38 +0000 (20:16 +0000)
2001-04-18  Havoc Pennington  <hp@redhat.com>

        Close bug #50615:

* gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
the layout

* gtk/gtktext.c: Use base/text instead of bg/fg throughout

* gtk/gtkentry.c: Use base/text instead of bg/fg throughout

* gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout

* gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
to blue for base, in addition to bg

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkentry.c
gtk/gtkstyle.c
gtk/gtktext.c
gtk/gtktextdisplay.c

index 6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891..38715891e5ffb67d2549730f5df46dfcadf80787 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+        Close bug #50615:
+       
+       * gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
+       the layout
+
+       * gtk/gtktext.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtkentry.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
+       
+       * gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
+       to blue for base, in addition to bg
+       
 2001-04-18  Havoc Pennington  <hp@redhat.com>
 
        * tests/testgtk.c (create_image): allow shrinking the image window
index 6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891..38715891e5ffb67d2549730f5df46dfcadf80787 100644 (file)
@@ -1,3 +1,19 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+        Close bug #50615:
+       
+       * gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
+       the layout
+
+       * gtk/gtktext.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtkentry.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
+       
+       * gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
+       to blue for base, in addition to bg
+       
 2001-04-18  Havoc Pennington  <hp@redhat.com>
 
        * tests/testgtk.c (create_image): allow shrinking the image window
index 6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891..38715891e5ffb67d2549730f5df46dfcadf80787 100644 (file)
@@ -1,3 +1,19 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+        Close bug #50615:
+       
+       * gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
+       the layout
+
+       * gtk/gtktext.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtkentry.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
+       
+       * gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
+       to blue for base, in addition to bg
+       
 2001-04-18  Havoc Pennington  <hp@redhat.com>
 
        * tests/testgtk.c (create_image): allow shrinking the image window
index 6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891..38715891e5ffb67d2549730f5df46dfcadf80787 100644 (file)
@@ -1,3 +1,19 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+        Close bug #50615:
+       
+       * gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
+       the layout
+
+       * gtk/gtktext.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtkentry.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
+       
+       * gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
+       to blue for base, in addition to bg
+       
 2001-04-18  Havoc Pennington  <hp@redhat.com>
 
        * tests/testgtk.c (create_image): allow shrinking the image window
index 6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891..38715891e5ffb67d2549730f5df46dfcadf80787 100644 (file)
@@ -1,3 +1,19 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+        Close bug #50615:
+       
+       * gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
+       the layout
+
+       * gtk/gtktext.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtkentry.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
+       
+       * gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
+       to blue for base, in addition to bg
+       
 2001-04-18  Havoc Pennington  <hp@redhat.com>
 
        * tests/testgtk.c (create_image): allow shrinking the image window
index 6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891..38715891e5ffb67d2549730f5df46dfcadf80787 100644 (file)
@@ -1,3 +1,19 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+        Close bug #50615:
+       
+       * gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
+       the layout
+
+       * gtk/gtktext.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtkentry.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
+       
+       * gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
+       to blue for base, in addition to bg
+       
 2001-04-18  Havoc Pennington  <hp@redhat.com>
 
        * tests/testgtk.c (create_image): allow shrinking the image window
index 6a0b4c146a7818fdf34a8ba6a5ed8e7dbe371891..38715891e5ffb67d2549730f5df46dfcadf80787 100644 (file)
@@ -1,3 +1,19 @@
+2001-04-18  Havoc Pennington  <hp@redhat.com>
+
+        Close bug #50615:
+       
+       * gtk/gtkstyle.c (gtk_default_draw_layout): Use text_gc to draw
+       the layout
+
+       * gtk/gtktext.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtkentry.c: Use base/text instead of bg/fg throughout
+
+       * gtk/gtktextdisplay.c: Use base/text instead of bg/fg throughout
+       
+       * gtk/gtkstyle.c (gtk_style_init): make GTK_STATE_SELECTED default
+       to blue for base, in addition to bg
+       
 2001-04-18  Havoc Pennington  <hp@redhat.com>
 
        * tests/testgtk.c (create_image): allow shrinking the image window
index e338bbf45d1b038f6396e640edb73b03cd22c8a1..84af9d3c7f01b693f4c887a92a8e7fccba88ffce 100644 (file)
@@ -846,7 +846,7 @@ gtk_entry_realize_cursor_gc (GtkEntry *entry)
       gdk_gc_set_rgb_fg_color (entry->cursor_gc, cursor_color);
     }
   else
-    entry->cursor_gc = gdk_gc_ref (GTK_WIDGET (entry)->style->bg_gc[GTK_STATE_SELECTED]);
+    entry->cursor_gc = gdk_gc_ref (GTK_WIDGET (entry)->style->base_gc[GTK_STATE_SELECTED]);
 }
 
 static void
@@ -2372,17 +2372,17 @@ gtk_entry_draw_text (GtkEntry *entry)
              rect.width = (ranges[2*i + 1] - ranges[2*i]) / PANGO_SCALE;
              rect.height = logical_rect.height / PANGO_SCALE;
              
-             gdk_draw_rectangle (entry->text_area, widget->style->bg_gc [GTK_STATE_SELECTED], TRUE,
+             gdk_draw_rectangle (entry->text_area, widget->style->base_gc [GTK_STATE_SELECTED], TRUE,
                                  rect.x, rect.y, rect.width, rect.height);
 
              gdk_region_union_with_rect (clip_region, &rect);
            }
 
-         gdk_gc_set_clip_region (widget->style->fg_gc [GTK_STATE_SELECTED], clip_region);
-         gdk_draw_layout (entry->text_area, widget->style->fg_gc [GTK_STATE_SELECTED], 
+         gdk_gc_set_clip_region (widget->style->text_gc [GTK_STATE_SELECTED], clip_region);
+         gdk_draw_layout (entry->text_area, widget->style->text_gc [GTK_STATE_SELECTED], 
                           x, y,
                           layout);
-         gdk_gc_set_clip_region (widget->style->fg_gc [GTK_STATE_SELECTED], NULL);
+         gdk_gc_set_clip_region (widget->style->text_gc [GTK_STATE_SELECTED], NULL);
          
          gdk_region_destroy (clip_region);
          g_free (ranges);
@@ -2416,7 +2416,7 @@ gtk_entry_draw_cursor (GtkEntry  *entry,
                     xoffset + strong_x, text_area_height - INNER_BORDER);
       
       if (weak_x != strong_x)
-       gdk_draw_line (entry->text_area, widget->style->fg_gc[GTK_STATE_NORMAL], 
+       gdk_draw_line (entry->text_area, widget->style->text_gc[GTK_STATE_NORMAL], 
                       xoffset + weak_x, INNER_BORDER,
                       xoffset + weak_x, text_area_height - INNER_BORDER);
     }
index b749777020eff4f2b7710d03968060e104f21526..d0c46fd91ca63537a9e22aed4a1e1146b737340e 100644 (file)
@@ -409,7 +409,8 @@ gtk_style_init (GtkStyle *style)
       style->text[i] = style->fg[i];
       style->base[i] = style->white;
     }
-  
+
+  style->base[GTK_STATE_SELECTED] = gtk_default_selected_bg;
   style->base[GTK_STATE_INSENSITIVE] = gtk_default_prelight_bg;
   style->text[GTK_STATE_INSENSITIVE] = gtk_default_insensitive_fg;
   
@@ -3913,7 +3914,7 @@ gtk_default_draw_layout (GtkStyle        *style,
   g_return_if_fail (window != NULL);
   
   if (area)
-    gdk_gc_set_clip_rectangle (style->fg_gc[state_type], area);
+    gdk_gc_set_clip_rectangle (style->text_gc[state_type], area);
 
   if (state_type == GTK_STATE_INSENSITIVE)
     {
@@ -3921,17 +3922,17 @@ gtk_default_draw_layout (GtkStyle        *style,
 
       ins = get_insensitive_layout (layout);
       
-      gdk_draw_layout (window, style->fg_gc[state_type], x, y, ins);
+      gdk_draw_layout (window, style->text_gc[state_type], x, y, ins);
 
       g_object_unref (G_OBJECT (ins));
     }
   else
     {
-      gdk_draw_layout (window, style->fg_gc[state_type], x, y, layout);
+      gdk_draw_layout (window, style->text_gc[state_type], x, y, layout);
     }
 
   if (area)
-    gdk_gc_set_clip_rectangle (style->fg_gc[state_type], NULL);
+    gdk_gc_set_clip_rectangle (style->text_gc[state_type], NULL);
 }
 
 static void
index 66c1a4824e7f211a7f3da91976f7b9154db40200..37d5a434950f6b9e52dbe99d97a2d45e603e025b 100644 (file)
@@ -1452,7 +1452,7 @@ clear_focus_area (GtkText *text, gint area_x, gint area_y, gint area_width, gint
        gc = text->bg_gc;
     }
   else
-    gc = widget->style->bg_gc[widget->state];
+    gc = widget->style->base_gc[widget->state];
 
   gdk_draw_rectangle (GTK_WIDGET (text)->window, gc, TRUE,
                      area_x, area_y, area_width, area_height);
@@ -4896,9 +4896,9 @@ draw_line (GtkText* text,
              (mark.index < selection_end_pos))
            {
              if (old_editable->has_selection)
-               fg_gc = GTK_WIDGET(text)->style->fg_gc[GTK_STATE_SELECTED];
+               fg_gc = GTK_WIDGET(text)->style->text_gc[GTK_STATE_SELECTED];
              else
-               fg_gc = GTK_WIDGET(text)->style->fg_gc[GTK_STATE_ACTIVE];
+               fg_gc = GTK_WIDGET(text)->style->text_gc[GTK_STATE_ACTIVE];
            }
          else
            {
index 3782cb82505e83d682fb8d132ec9fa67cf17d55c..17e3f5b5605fa867fca5447b62f3e4f9770b6cb1 100644 (file)
@@ -250,7 +250,7 @@ render_layout_line (GdkDrawable        *drawable,
       
       if (selected)
         {
-          fg_gc = render_state->widget->style->fg_gc[GTK_STATE_SELECTED];
+          fg_gc = render_state->widget->style->text_gc[GTK_STATE_SELECTED];
         }
       else
         {
@@ -517,7 +517,7 @@ render_para (GdkDrawable        *drawable,
           selection_end_index > line->length + byte_offset) /* All selected */
         {
           gdk_draw_rectangle (drawable,
-                              render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
+                              render_state->widget->style->base_gc[GTK_STATE_SELECTED],
                               TRUE,
                               x + line_display->left_margin,
                               selection_y,
@@ -548,11 +548,11 @@ render_para (GdkDrawable        *drawable,
                                                           selection_height,
                                                           selection_start_index, selection_end_index);
 
-              gdk_gc_set_clip_region (render_state->widget->style->fg_gc [GTK_STATE_SELECTED], clip_region);
-              gdk_gc_set_clip_region (render_state->widget->style->bg_gc [GTK_STATE_SELECTED], clip_region);
+              gdk_gc_set_clip_region (render_state->widget->style->text_gc [GTK_STATE_SELECTED], clip_region);
+              gdk_gc_set_clip_region (render_state->widget->style->base_gc [GTK_STATE_SELECTED], clip_region);
 
               gdk_draw_rectangle (drawable,
-                                  render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
+                                  render_state->widget->style->base_gc[GTK_STATE_SELECTED],
                                   TRUE,
                                   x + PANGO_PIXELS (line_rect.x),
                                   selection_y,
@@ -564,8 +564,8 @@ render_para (GdkDrawable        *drawable,
                                   y + PANGO_PIXELS (baseline),
                                   TRUE);
 
-              gdk_gc_set_clip_region (render_state->widget->style->fg_gc [GTK_STATE_SELECTED], NULL);
-              gdk_gc_set_clip_region (render_state->widget->style->bg_gc [GTK_STATE_SELECTED], NULL);
+              gdk_gc_set_clip_region (render_state->widget->style->text_gc [GTK_STATE_SELECTED], NULL);
+              gdk_gc_set_clip_region (render_state->widget->style->base_gc [GTK_STATE_SELECTED], NULL);
 
               gdk_region_destroy (clip_region);
 
@@ -575,7 +575,7 @@ render_para (GdkDrawable        *drawable,
                    (line_display->direction == GTK_TEXT_DIR_RTL && selection_end_index > byte_offset + line->length)))
                 {
                   gdk_draw_rectangle (drawable,
-                                      render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
+                                      render_state->widget->style->base_gc[GTK_STATE_SELECTED],
                                       TRUE,
                                       x + line_display->left_margin,
                                       selection_y,
@@ -595,7 +595,7 @@ render_para (GdkDrawable        *drawable,
                     PANGO_PIXELS (line_rect.x) - PANGO_PIXELS (line_rect.width);
 
                   gdk_draw_rectangle (drawable,
-                                      render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
+                                      render_state->widget->style->base_gc[GTK_STATE_SELECTED],
                                       TRUE,
                                       x + PANGO_PIXELS (line_rect.x) + PANGO_PIXELS (line_rect.width),
                                       selection_y,
@@ -786,9 +786,9 @@ gtk_text_layout_draw (GtkTextLayout *layout,
           GdkGC *gc;
 
           if (cursor->is_strong)
-            gc = widget->style->bg_gc[GTK_STATE_SELECTED];
+            gc = widget->style->base_gc[GTK_STATE_SELECTED];
           else
-            gc = widget->style->fg_gc[GTK_STATE_NORMAL];
+            gc = widget->style->text_gc[GTK_STATE_NORMAL];
 
           gdk_draw_line (drawable, gc,
                          line_display->x_offset + cursor->x - x_offset,